import java.util.*;
import java.text.*;

public class  Calendar_Seeker {
	
   public static void main(String[] args){
     Scanner inputUserData = new Scanner(System.in);
     
     System.out.println("Enter a day(from 1 to 31): ");
     int day = inputUserData.nextInt();
     System.out.println("Enter a month(from 1 to 12): ");
     int month = inputUserData.nextInt()-1;
     System.out.println("Enter a year: ");
     int year = inputUserData.nextInt();
     
     Date currentDate = (new GregorianCalendar(year, month, day)).getTime();
     SimpleDateFormat dateFormat = new SimpleDateFormat("EEEE");
     String dayOfWeek = dateFormat.format(currentDate);
     
     System.out.println(dayOfWeek);
     }
}
